package com.woniuxy.amusementparkos.service.lzw.impl;

import com.woniuxy.amusementparkos.entity.lzw.Vaults;
import com.woniuxy.amusementparkos.dao.lzw.VaultsDao;
import com.woniuxy.amusementparkos.service.lzw.VaultsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Vaults)表服务实现类
 *
 * @author makejava
 * @since 2020-04-23 14:50:10
 */
@Transactional // 涉及金钱，全部支持事务
@Service("vaultsService")
public class VaultsServiceImpl implements VaultsService {
    @Resource
    private VaultsDao vaultsDao;

    /**
     * 获取金库数据
     *
     * @return 实例对象
     */
    @Override
    public Vaults getVault() {
        return this.vaultsDao.getVault();
    }


    /**
     * 新增数据
     *
     * @param vaults 实例对象
     * @return 实例对象
     */
    @Override
    public Vaults insert(Vaults vaults) {
        this.vaultsDao.insert(vaults);
        return vaults;
    }

    /**
     * 修改数据
     *
     * @param vaults 实例对象
     * @return 实例对象
     */
    @Override
    public Vaults update(Vaults vaults) {
        this.vaultsDao.update(vaults);
        return this.getVault();
    }

}